FIG. 1 represents a configuration of a satellite decoder using a recording of an MPEG data stream on hard disc.
An MPEG program stream (PS) is received at the input of a multiplexer 1. The latter outputs the data of a program in the form of PES data packets (the initials standing for Packetized Elementary Stream). These data are sent to a memory 2 and then to a hard disc 4 by way of a disc interface 3, for their recording.
For the reading of the data, the hard disc 4 is linked to a disc interface 5 and then to a memory 6. A first memory output is linked to a video MPEG decoding circuit 7 and a second memory output is linked to an audio MPEG decoding circuit 8. The output from each of these circuits corresponds to the video and audio cues transmitted to digital/analogue converters and then to a television receiver (which are not represented in the figure).
The memory circuit 6 makes it possible, among other things, to demultiplex the audio and video data stored on the hard disc. These video PES and audio PES data are thereafter processed by their respective decoders.
The data stored on the hard disc are the data obtained after demultiplexing the stream. Hence, one is not dealing with storage of the PS program stream, thus avoiding the regeneration of such a stream on reading, the storage of all the programs constituting this stream, or the storage of the scrambled data with recording of key words etc.
The manner of operation of a decoder according to the MPEG standard, in a conventional configuration, that is to say one which receives the data stream directly with a given transmission bit rate, for example via satellite transmission or via cable, is recalled hereinbelow so as to stress the particular characteristics relating to an environment with hard disc, that is to say with intermediate storage of the data on hard disc before decoding.
Management of the buffer memory of a decoder is performed, in the MPEG standard, on the basis of modelling referred to as a virtual memory. Indeed, the coding of each image constituting a sequence is not carried out at constant cost and a buffer memory at the output of the coder is used to deliver a data stream at constant mean bit rate. On the decoder side, a buffer memory is also required so as to deliver, from the constant-bit-rate data stream, variable-cost images. Management of the buffer memory of the decoder is performed on the basis, among other things, of the clocks transmitted by the coder in the data stream and of the tags allocated to the images transmitted and defining the instant of exit from the memory of the decoder, the time gap between the instant of storage of an image in the memory of the coder and the instant of reading of the memory of the decoder having to be the same for each image.
This involves the PCR clock, standing for Program Clock Reference in the MPEG standard, which is a time cue transmitted in the data stream and on the basis of which the synchronization of the decoder is performed.
This also involves the DTS tag, standing for Decoding Time Stamp in the MPEG standard, which is a field transmitted in the stream and which indicates the instant at which an image is to be decoded in the decoder.
The PCR cue present in the transport stream TS is used by the decoder to calculate the time. The PCR therefore delivers the scheduling tag at decoder level.
The DTS gives the decoding schedules, that is to say the instant at which the image must be read from the buffer memory of the decoder and decoded.
The PCR and DTS cues are transmitted respectively in 188-byte packet headers of the transport stream TS and in packet headers of the PES stream, the first packetization step required in the production of a transport stream TS.
The initials PTS, standing for Presentation Time Stamp, correspond to the instant of display of the image and allow the reordering of the images after decoding; the PTS is present in the packet headers of the PES stream.
When the MPEG decoder operates on the basis of the data originating from the hard disc, these data are consumed at the tempo of the decoder. The synchronization signals of the audio and video decoders for displaying the decoded images (VSYNC) are regulated by the local 27 MHz clock so as to deliver 25 images per second approximately.
Since the recording is carried out at the level of the audio and video PESs, the cue relating to the PCR of the PS stream is lost and may not therefore serve in the slaving of the local clock. This absence of slaving generates a management problem at the level of the write and read pointers of the hard disc as well as a synchronization problem at the level of the audio and video signals.
As regards the management of the pointers, two modes are to be considered: the read only mode, that is to say without simultaneous writing of the hard disc, for which the problem is not too troublesome, and the read/write mode.
In read only mode, when a previously recorded stream is replayed, the accuracy of the local clock in free oscillation is sufficient. The variation relative to the nominal value of the recording is found within the duration of the 40 ms video image. The tolerance at television and viewer level is sufficiently large to be able to make do with much lower accuracy than the standards of professional television.
This is because the image synchronization signal (VSYNC) is defined on the basis of the 27 MHz clock. It has a period of 40 ms. A slow drifting of this signal, due to the accuracy of the local clock, is not at all troublesome owing to the fact that the television is at the end of the transmission chain.
On the other hand, in write/read mode (read shifted with respect to write mode, more commonly known as Time Shifting), malfunctions may occur due to the fact that this clock is in free oscillation, it not being possible to slave it to the stream read back from the disc.
When recording and reading are simultaneous, the case of time-shifted replaying, there is a risk that writing will be overtaken by reading on the disc, or that there will be an increase in the delay. Since the drifting is slow, this second case is not too troublesome. On the other hand, if reading overtook writing, that is to say if the read pointer overtook the write pointer and went off to read as yet unwritten memory areas, the image depicted would at best be what has been recorded in this area during a previous recording and the images being recorded could no longer be replayed. This situation can occur when the shift between recording and reading is due to a short pause in reading. In this case, and if the 27 MHz clock is slightly faster than that used by the coder when coding the data, the replaying of the data is faster than their recording and over a long period, that is to say for a recorded program of a certain duration, the read pointer can overtake the write printer. In this mode it is therefore necessary to prohibit such slippage between writing and reading.
One idea would be to slave the local clock to the PCRs (Program Clock References) of the incident stream while being recorded. However, this would not solve another malfunction which may occur on account of the fact that the validity of the recorded data is not known a priori. Since writes and reads are synchronous, in the case where the local clock is synchronized to the PCRs of the incident stream, the delay between reading and writing will be maintained unless the decoder begins to consume the data very quickly. This may happen if the data are corrupted. Indeed, while in the case of a real-time (live) transmission, these erroneous data can be detected immediately upon reading the buffer of the decoder, the same does not hold when recording on hard disc which enables such erroneous data to be detected only after the reading and storage of these data in the buffer of the decoder. When corrupted data are detected by the decoder, the latter re-synchronizes and instantaneously empties the buffer, causing the loss of data and accesses to the hard disc which are repeated for the filling of this buffer. In this case, it may happen that the read pointer overtakes the write pointer. This can occur upon transmission of erroneous cues or upon loss of data transmission owing for example to poor transmission conditions.
As far as the synchronization of the audio and video data is concerned, be it in read only mode or read/write mode, the fact of not being able to initialize and synchronize the local clock to the PCR cue, for example in read only mode, may give rise to a problem of synchronization between the video and the audio. This is because the cues relating to the instants of presentation relative to the local clock cannot be utilized on account of the fact that this clock is no longer synchronized with that of the coder.
The aim of the invention is to alleviate the aforesaid drawbacks.